package com.jhg.drgclinicalpathway.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jhg.drgclinicalpathway.domain.KeyVal;
import com.jhg.drgclinicalpathway.domain.PathTplMeta;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface PathTplMetaDao extends BaseMapper<com.jhg.drgclinicalpathway.domain.PathTplMeta> {

    @Select({
            "<script>",
            "select a.字段值 k1,b.分组编码 k2 from 路径模板元数据 a left join 路径模板 b on a.模板ID=b.id",
            "where a.备注='适用疾病' and a.模板ID!=#{tplid} and 字段名称 in",
            "<foreach collection='ls' open='(' close=')' item='id' index='i' separator=','>",
            "#{id}",
            "</foreach>",
            "group by a.字段值,b.分组编码",
            "</script>"
    })
    public List<KeyVal> check适用疾病(@Param("tplid") String tplid, @Param("ls")List<String> ls);
}
